<?php
/**

 */
class App_Validate_UniqueEmail extends Zend_Validate_Abstract
{
    const EMAIL_EXISTS = 'emailExists';

    /**
     * @var array
     */
    protected $_messageTemplates = array(
        self::EMAIL_EXISTS => "is already in use."
    );

    public function isValid($value)
    {
        $this->_setValue((string) $value);

        $model_user = new Model_User();
        try{
            $user = $model_user->getUserByEmail($value);
            //$this->_error();
            return false;
        }
        catch (Exception $e){
            
        }

        return true;
    }

}

